/* OSM layers for gvSIG. 
 * Geographic Information System of the Valencian Government
*
* Copyright (C) 2012 Nacho Brodin
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
* MA  02110-1301, USA.
* 
*/
package org.gvsig.raster.osm.cachestruct;

import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.util.ArrayList;

import org.kxml2.io.KXmlParser;
import org.xmlpull.v1.XmlPullParserException;


/**
 * <p>Defines a set of tiles</p>
 * @author Nacho Brodin (nachobrodin@gmail.com)
 */
public class TileMatrixSet {
    protected Rectangle2D                 bbox                = null;
    private String                        supportedCRS        = null;
    protected ArrayList<TileMatrix>       tileMatrix          = null;
    
	public void setBbox(Rectangle2D bbox) {
		this.bbox = bbox;
	}
	
    public Rectangle2D getBoundingBox() {
    	return bbox;
    }
	
	public ArrayList<TileMatrix> getTileMatrix() {
		if(tileMatrix == null)
			tileMatrix = new ArrayList<TileMatrix>();
		return tileMatrix;
	}

	public String getSupportedCRS() {
		return supportedCRS;
	}

	public void setSupportedCRS(String supportedCRS) {
		this.supportedCRS = supportedCRS;
	}
	
	public void parse(KXmlParser parser) throws IOException,
			XmlPullParserException {
	}
	
	public void print() {
		System.out.println("*****TileMatrixSet******");
		if(bbox != null)
			System.out.println(bbox.toString());
		System.out.println("supportedCRS:" + getSupportedCRS());
		for (int i = 0; i < tileMatrix.size(); i++) {
			((TileMatrix)tileMatrix.get(i)).print();	
		}
		
	}
}
